import 'package:json_annotation/json_annotation.dart';
part 'version.g.dart';

@JsonSerializable()
class VersionResult {
  final bool success;
  final String message;
  final VersionInfo data;

  const VersionResult(
    this.success,
    this.message,
    this.data,
  );

  factory VersionResult.fromJson(Map json) => _$VersionResultFromJson(json);
  Map toJson() => _$VersionResultToJson(this);
}

@JsonSerializable()
class VersionInfo {
  final int id;
  final String version;
  final String remark;
  final String downloadUrl;

  VersionInfo(
    this.id,
    this.version,
    this.remark,
    this.downloadUrl,
  );

  factory VersionInfo.fromJson(Map json) => _$VersionInfoFromJson(json);
  Map toJson() => _$VersionInfoToJson(this);
}
